package com.zha;

import java.sql.*;

public class Tianjia {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        //连接驱动
        Class.forName("org.apache.phoenix.jdbc.PhoenixDriver");
        //得到连接对象
        Connection connection = DriverManager.getConnection("jdbc:phoenix:hbase:2181");

        String sql1 = "upsert into persion(ID,NAME,AGE) VALUES(700,'huanshen',22)";
       //根据连接对象得到发送器
        PreparedStatement statement = connection.prepareStatement(sql1);
      //开始发送
        int resultSet = statement.executeUpdate();
//        statement.executeUpdate();
        connection.commit();

        System.out.println("1");
        statement.close();
        connection.close();
    }
}